from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    def sou(self):
        print('点击搜索框')
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.widget.RelativeLayout").instance(3)')
        ele = self.find_ele(loc)
        return ele
    def shu(self):
        print('输入搜索内容')
        loc = (By.CLASS_NAME,'android.widget.EditText')
        ele = self.find_ele(loc)
        return ele
    def suo(self):
        print('点击搜索')
        loc = (By.ID,'com.achievo.vipshop:id/tv_search')
        ele = self.find_ele(loc)
        return ele
    def jin(self):
        print('点击进店')
        loc = (By.XPATH,'//android.widget.TextView[@resource-id="com.achievo.vipshop:id/tv_brand_button1"]')
        ele = self.find_ele(loc)
        return ele
    def tu(self):
        print('点击图片')
        loc = (By.XPATH,'(//android.widget.RelativeLayout[@resource-id="com.achievo.vipshop:id/image_main_layout"])[1]/android.widget.FrameLayout')
        ele = self.find_ele(loc)
        return ele
    def duany(self):
        print('断言')
        loc = (By.XPATH,'(//android.widget.TextView[@content-desc="已选定销量"])[2]')
        ele = self.find_ele(loc)
        return ele
    def duany2(self):
        print('断言2')
        loc = (By.XPATH,'(//android.widget.TextView[@content-desc="已选定价格"])[2]')
        ele = self.find_ele(loc)
        return ele



